package d08_reflect_getclass;

import java.lang.reflect.Method;

public class TestReflect {
    public static void main(String[] args) throws Exception {
        // 获取DemoClass的字节码Class
        Class<?> clazz = Class.forName("d08_reflect_getclass.DemoClass");
        
        // 通过Class获取run方法对象
        Method runMethod = clazz.getMethod("run");
        
        // 创建DemoClass实例
        Object demoClassInstance = clazz.newInstance();
        
        // 执行run方法对象
        runMethod.invoke(demoClassInstance);
    }
}